package iot.wlink.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import iot.wlink.bean.entity.Device;
import iot.wlink.bean.dao.DeviceSessionDo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author : willian fu
 * @date : 2021/8/23
 */
public interface DeviceMapper extends BaseMapper<Device> {

    @Select("select d.tid, d.uid, d.secret, dt.model, dt.device_type, dt.protocol protocols_type " +
            "from device d left join device_template dt on d.uid = #{uid}")
    DeviceSessionDo getSession(@Param("uid") String uid);
}
